optimizing cpu with pyhton